const state = () => ({
  username: window.localStorage.getItem('username') || '',
  isAdmin: JSON.parse(window.localStorage.getItem('isAdmin')) || false,
  avatar: window.localStorage.getItem('avatar') || '',
})

const actions = {

}

const mutations = {
  USER_NAME(state, payload) {
    state.username = payload.username
    state.isAdmin = payload.isAdmin
    state.avatar = payload.avatar
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}